<#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
UPDATE `c1_entity_log` SET `DATA_STATE_ID` = :dataStateId
WHERE (`DATA_STATE_ID` = NULL OR `DATA_STATE_ID` <> :dataStateId)
<#if StringUtils.isNotBlank(id)>
AND ID = :id AND CLIENT_ID = :clientId
<#else>
AND CLIENT_ID = :clientId
</#if>
